function [] = send_mail()
%UNTITLED4 Summary of this function goes here
%   Detailed explanation goes here

% Define these variables appropriately:
mail = 'masterayan@gmail.com'; %Your GMail email address
password = 'dorothytoy!15'; %Your GMail password

% Then this code will set up the preferences properly:
setpref('Internet','E_mail',mail);
setpref('Internet','SMTP_Server','smtp.gmail.com');
setpref('Internet','SMTP_Username',mail);
setpref('Internet','SMTP_Password',password);
props = java.lang.System.getProperties;
props.setProperty('mail.smtp.auth','true');
props.setProperty('mail.smtp.socketFactory.class', 'javax.net.ssl.SSLSocketFactory');
props.setProperty('mail.smtp.socketFactory.port','465');

% Send the email. Note that the first input is the address you are sending the email to

for i=1:10
    
a=round(500*rand);
b=num2str(a);
str1=strcat('Test from Matlab ', b);
str2=strcat('surreal ', b);

sendmail('masterayan@gmail.com',str1,str2);

end

end

